######################################################## 
## MOD Title: Delete User MOD
## MOD Author: ycl6 < ycl6@users.sourceforge.net > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## MOD Description: Admin can delete user from viewtopic, userprofile and memberlist
## MOD Version: 1.0.1
## 
## Installation Level: Easy 
## Installation Time: 5 Minutes 
##
## Files To Edit: 3
##	includes/usercp_viewprofile.php
##	language/lang_english/lang_main.php
##	templates/subSilver/profile_view_body.tpl
##
## Included Files: 1
##	delete_user.php
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
################################################################# 
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes:
## 	Tested on 2.0.21. Can be installed using EasyMOD 0.3.0
##
## 	Monitor update status: http://sourceforge.net/project/filemodule_monitor.php?filemodule_id=191291
## 
############################################################## 
## MOD History: 
##
##   2006-05-20 - Version 1.0.0
##      - Initial Release
##
##   2006-06-24 - Version 1.0.1
##      - Fix an unexpected '}' error in usercp_viewprofile.php
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

# 
#-----[ COPY ]------------------------------------------ 
#
copy delete_user.php to delete_user.php
# 
#-----[ OPEN ]------------------------------------------ 
#
includes/usercp_viewprofile.php
# 
#-----[ FIND ]------------------------------------------ 
#
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>';
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
// Delete User MOD
if ( $userdata['user_level'] == ADMIN && $profiledata['user_id'] != ANONYMOUS )
{
	$temp_url = append_sid("delete_user.$phpEx?" . POST_USERS_URL .'=' . $profiledata['user_id'] . "&amp;file=profile&amp;sid=" . $userdata['session_id']);
	$delete_user_img = '&nbsp;<a href="' . $temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . sprintf($lang['Delete_user'], $profiledata['username']) . '" title="' . sprintf($lang['Delete_user'], $profiledata['username']) . '" border="0" /></a>';
	$delete_user = '<a href="' . $temp_url . '">' . sprintf($lang['Delete_user'], $profiledata['username']) . '</a> <b>Caution - <font color="red">(No Undo)</font></b>';
}
else
{
	$delete_user_img = '';
	$delete_user = '';
}
# 
#-----[ FIND ]------------------------------------------ 
#
	'USERNAME' => $profiledata['username'],
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	'DELETE_USER_IMAGE' => $delete_user_img,	// Delete User MOD
	'DELETE_USER' => $delete_user,			// Delete User MOD
# 
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/profile_view_body.tpl
# 
#-----[ FIND ]------------------------------------------ 
#
#	<td class="catRight" width="60%"><b><span class="gen">{L_ABOUT_USER}</span></b></td>
U_ADMIN_EDIT_PROFILE}	
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
		<td class="row1" colspan="2" align="left"><span class="gen">
			<ol><li>{DELETE_USER}<br /><br />
			<li><a href="{U_ADMIN_EDIT_PROFILE}">{L_ADMIN_EDIT_PROFILE}</a><br /><br />
			<li><a href="{U_ADMIN_EDIT_PERMISSIONS}">{L_ADMIN_EDIT_PERMISSIONS}</a></ol> 
			<ul><li>{L_USER_ACTIVE_INACTIVE}<br />
			<li>{L_BANNED_USERNAME}<br />
			<li>{L_BANNED_EMAIL}</ul>
			</span>
		</td>
# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_main.php
# 
#-----[ FIND ]------------------------------------------ 
#
?>
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
// Delete User MOD
$lang['Delete_user'] = 'Delete user: %s';
$lang['Confirm_delete_user'] = 'Are you sure you want to delete user: %s';
$lang['User_deleted'] = 'User was successfully deleted';
$lang['Click_return_memberlist'] = 'Click %sHere%s to return to memberlist';
$lang['Cannot_delete_self'] = 'Cannot delete yourself';
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM